package org.sword.wechat4j.api.request.message;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.sword.wechat4j.api.request.ApiRequest;
import org.sword.wechat4j.api.response.message.MsgInfo;

/**
 * 发送模板消息
 * data字段结构为 以TemplateData 类型 template定义的变量名为字段名，
 * Created by sean on 2016-07-20-0020.
 */
public final class Cgi_binMessageTemplateSendPost extends ApiRequest<MsgInfo> {

    private String touser;
    private String template_id;
    private String url;
    private JSONObject data;

    public String getTouser() {
        return touser;
    }

    public void setTouser(String touser) {
        this.touser = touser;
    }

    public String getTemplate_id() {
        return template_id;
    }

    public void setTemplate_id(String template_id) {
        this.template_id = template_id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public JSONObject getData() {
        return data;
    }

    public void setData(String data) {
        this.data = JSON.parseObject(data);
    }
}
